
try{
    var DHTMLUtil = _js.dhtml.DHTMLUtil;
    var StyleUtil = _js.dhtml.StyleUtil;
    var SelectUtil= _js.dhtml.SelectUtil;
    var MaskObjects= _js.mask.MaskObjects;
    var DateMask= _js.mask.DateMask;
    var DecimalMask= _js.mask.DecimalMask;
    var FixMask= _js.mask.FixMask;
    var DoubleFixMask= _js.mask.DoubleFixMask;
}catch(e){}


  function executeForm(nForm,nAction, method){
	  document.forms[nForm].action = nAction + '?method=' + method; 
	  
        var observe = document.forms[nForm].onsubmitListener;
 
        if(observe){
      
            for(var i=0; i<observe.length; i++)
                observe[i]();
        }   
        
        if (validForm(nForm, nAction, method)){      
          document.forms[nForm].submit();
          return true;
        }
        return false;
    }
    
  
   function executeFormNewWindow(nForm,nAction, method, windowName, windowOptions){
	  document.forms[nForm].action = nAction + '?method=' + method; 
	  
        var observe = document.forms[nForm].onsubmitListener; 
        if(observe){
      
            for(var i=0; i<observe.length; i++)
                observe[i]();
        }   
        

        if (validForm(nForm, nAction, method)){    	                	
			var newWin = window.open("", windowName, windowOptions);
			if(newWin ==null || typeof(newWin)=="undefined" ) {
				alert(Global_Resources_Messages['app.desblock.popup']);
				return;
			}			
			var target = document.forms[nForm].target;
			document.forms[nForm].target = windowName;
            document.forms[nForm].submit();
            document.forms[nForm].target = target;
            return true;            
        }
        return false;
    }
    
 
 	function IsPopupBlocker() { alert(1);
		var oWin = window.open("","testpopupblocker","width=100,height=50,top=5000,left=5000");
		if (oWin==null || typeof(oWin)=="undefined") {
			alert(Global_Resources_Messages['app.desblock.popup']);
			return true;
		} else {
			oWin.close();
			return false;
		}
	}
	
	
  function validForm(nForm,nAction, method){    
	cleanErros(); 	
    return (!document.forms[nForm].onsubmit || document.forms[nForm].onsubmit());
  }
  
    
    
   function cleanErros(){ 
      var jnl = document.getElementById('div.struts.errors');
  	  if (jnl) jnl.innerHTML='';
	  jnl = document.getElementById('div.struts.msg');
	  if (jnl) jnl.innerHTML='';       
   }
   
   function back(){  	  
     window.open(contexto()+ 'default.do?method=back', '_self');
   }
   
     function popBack(){  	  
     window.open(contexto()+ 'default.do?method=popBack', '_self');
   }
 
 
   
   function recall(){  	  
     window.open(contexto()+ 'default.do?method=recall', '_self');
   }
   
    function recallForm(nForm){  	  
     executeForm(nForm,contexto()+ 'default.do', 'recall');
   }
      
   function reset(form){		
    	form.reset();
    	
   }
   
   
    function refresh(){	
		window.refresh();
   }
   
   function checkAll(name){
	   	var checks = document.getElementsByName(name);
	  	for (var i = 0; checks && checks.length && i < checks.length;i++){
	  		checks[i].checked = true;
	  	}
   }

   function uncheckAll(name){
	   	var checks = document.getElementsByName(name);
	  	for (var i = 0; checks && checks.length && i < checks.length;i++){
	  		checks[i].checked = false;
	  	}
   }
   
   
  function blankOrNull(field){  
	return	blankOrNullValue(field.value);
  }
  
  function blankOrNullValue(value){  
  	if( value == null){
  		return true;
  	}
  	for(var i = 0; i < value.length; i++){
  		if(value[i] != " "){
  			return false;
		}
  	}
  	return true;
  }
          
          
   function limitLength(field, max){
	    var tamanho = field.value.length;
    	if(tamanho > max) {
	      field.value = field.value.substring(0,max);
    	}
   }        
   
   function openPopUp(id){
		document.getElementById(id).open();
   }
   
   function closePopUp(id){
		document.getElementById(id).close();
   }   
   
   function isZeroValue(value){
	  	if( value == null){
	  		return true;
	  	}
	  	var zeroReg = new RegExp("^[0,\\.]*$");	
	  	return zeroReg.test(value);
  }
   
       
        